package com.gosophia.dataDictionary.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.dataDictionary.dto.DataValueDTO;
import com.gosophia.dataDictionary.ws.DataDictionaryWebService;



/**
 * 编辑数据值
 * @author tianchunyu
 *
 */
@Controller
@Scope("prototype")
public class UpdateDataValueAction extends BaseAjaxAction<DataValueDTO> {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    public DataValueDTO getDetailData() {
        if(this.detailData==null){
            this.detailData = new DataValueDTO();
        }
        return this.detailData;
    }

    @Autowired
    private DataDictionaryWebService dataDictionaryWebService;
    
    @LogRecord(eventAction="数据字典-更新数据值",eventTarget="detailData")
    @Override
    public String _execute() throws Exception {
        
        dataDictionaryWebService.updateDataValue(this.detailData);
        super.getRequestResult().setRsltCode("0");
        super.getRequestResult().setMessage("更新数据值成功");
        
        return SUCCESS;
    }
}
